#ifndef EYERWANDARTIST_EWAPRJTRACK_HPP
#define EYERWANDARTIST_EWAPRJTRACK_HPP

#include <vector>

#include "EyerCore/EyerCore.hpp"

#include "EWAPrjFragment.hpp"

namespace Eyer
{
    class EWAPrjTrack;

    class EWAPrjTrackListener
    {
    public:
        virtual int OnFragmentUpdate(EWAPrjTrack * track) = 0;
    };

    class EWAPrjTrack
    {
    public:
        EWAPrjTrack();
        EWAPrjTrack(const EyerString & _trackId);
        virtual ~EWAPrjTrack();

        const EyerString & GetTrackId();

        int PushFragmentBack(const EyerSmartPtr<EWAPrjFragment> & fragment);

        int GetFragmentCount();
        EyerSmartPtr<EWAPrjFragment> GetFragment(int index);

        int RegisterListener(EWAPrjTrackListener * listener);
        int UnregisterListener(EWAPrjTrackListener * listener);

    private:
        EyerString trackId = "";
        std::vector<EyerSmartPtr<EWAPrjFragment>> fragmentList;

        std::vector<EWAPrjTrackListener *> listenerList;
        int Update();
    };
}

#endif //EYERWANDARTIST_EWAPRJTRACK_HPP
